import request from "@/utils/request";

/**
 * 申请成为师傅
 * 
 */
export function yxTechnician(data) {
    return request.post("/yxTechnician", data);
}
/**
 * 修改师傅信息
 * 
 */
export function editTechnician(data) {
    return request.put("/yxTechnician", data);
}
/**
 * 
查询师傅详情
 * 
 */
export function details(data) {
    return request.get(`/yxTechnician/details/${data.id}?lat=${data.lat}&log=${data.log}`);
}

/**
 * 
查询个人师傅信息
 * 
 */
export function getTechniciansinfo() {
    return request.get("/yxTechnician/techniciansinfo");
}
/**
 * 
服务分类
 * 
 */
export function yxTechnicianCategory() {
    return request.get("/yxTechnicianCategory");
}
/**
 * 
人气推荐
 * 
 */
export function getInfoList(data) {
	
	let isPopular=data.isPopular?'&isPopular='+data.isPopular:''
	let sex=data.sex?'&sex='+data.sex:''
	let type=data.type?'&type='+data.type:''
	let technicianName=data.technicianName?'&technicianName='+data.technicianName:''  
    return request.get(`/yxTechnician?page=${data.page}&size=${data.size}&lat=${data.latitude}&log=${data.longitude}&state=${data.state}&nearby=${data.nearby}`+isPopular+sex+type+technicianName);
}

/**
 * 
新增项目
 * 
 */
export function addItem(data) {
    return request.post(`/yxTechnicianItem`,data);
}
/**
 * 
查询订单详情
 * 
 */
export function ordersDetails(id) {
    return request.get(`/yxTechnicianOrder/orders/details/${id}`);
}
/**
 * 
查询订单详情
 * 
 */
export function delOrder(data) {
    return request.get(`/yxTechnicianOrder/delete/order/${data.ids}`,);
}
/**
 * 
订单列表
 * 
 */
export function getOrderList(data) {
	
	let technicianId=data.technicianId?'&technicianId='+data.technicianId:''
	let paid=data.paid?'&paid='+data.paid:''
	
    return request.get(`/yxTechnicianOrder?page=${data.page}&size=${data.size}&status=${data.status}${technicianId}${paid}`);
}
/**
 * 
创建订单
 * 
 */
export function addOrder(data) {
    return request.post(`/yxTechnicianOrder/order/create`,data);
}
/**
 * 
创建订单
 * 
 */
export function confirm(data) {
    return request.post(`/yxTechnicianOrder/order/confirm`,data);
}
/**
 * 
订单支付
 * 
 */
export function pay(data) {
    return request.post(`/yxTechnicianOrder/order/pay`,data);
}

/**
 * 
获取技师预约时间
 * 
 */
export function date(id) {
    return request.get(`/yxTechnicianOrder/already/arranged/date/`+id,);
}
/**
 * 
更新订单状态
 * 
 */
export function orderStatus(data) {
    return request.get(`/yxTechnicianOrder/update/order/status/${data.id}?status=${data.status}`,);
}

/**
 * 
创建订单
 * 
 */
export function Modes() {
    return request.get(`/yxTechnicianTravelModes`);
}

/**
 * 
修改项目
 * 
 */
export function editItem(data) {
    return request.put(`/yxTechnicianItem`,data);
}
/**
 * 
计算金额
 * 
 */
export function computed(data) {
    return request.post(`/yxTechnicianOrder/order/computed`,data);
}
/**
 * 
删除项目
 * 
 */
export function delItem(data) {
    return request.delete(`/yxTechnicianItem/`+data.ids);
}
/**
 * 
项目列表
 * 
 */
export function initDataItem(data) {
    return request.get(`/yxTechnicianItem?technicianId=${data.technicianId}&page=${data.page}&size=${data.size}`);
}


